package abstractfactory.product;

import abstractfactory.creator.abstractorinterface.PizzaIngredientFactory;
import abstractfactory.product.abstracts.Pizza;

/**
 * @ClassName: CheesePizza
 * @Description: 培根披萨
 * @Date: 2021/1/12 17:02
 * @Author: Song JinGen
 */
public class BaconPizza extends Pizza {
    PizzaIngredientFactory factory;
    public BaconPizza(PizzaIngredientFactory factory){
        name = "培根披萨";
        this.factory = factory;
    }

    @Override
    public void prepare() {
        cheese = factory.createCheese();
        sauce = factory.createSauce();
        System.out.println("准备"+cheese.getName()+","+sauce.getName()+","+name);
    }
}
